//
//  PersonViewController.m
//  Streaming
//
//  Created by 官琛 on 15-6-24.
//  Copyright (c) 2015年 liuxun. All rights reserved.
//

#import "PersonViewController.h"

@interface PersonViewController ()

@end

@implementation PersonViewController

- (void)dealloc
{
    [self.movieDetail dealloc];
    
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    PersonView *perView = [[PersonView alloc]initWithFrame:[[UIScreen mainScreen]bounds] perId:self.personId];
    perView.myButtonDelegate = self;
    [self.view addSubview:perView];
    [perView autorelease];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"iconfont-unie642.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarButtonItemAction)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
}
- (void)leftBarButtonItemAction
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)present:(NSInteger)movieID
{
    self.movieDetail = [[MovieDetailViewController alloc] init];
    self.movieDetail.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:self.movieDetail animated:YES];
    self.movieDetail.movieID = movieID;
    NSLog(@"===%ld", (long)self.movieDetail.movieID);
    [self.movieDetail release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
